{% load thumbnail %}
{% load imagestore_tags %}
<div id='gallery'>
    {% for image in album.images.all %}
        {% thumbnail image.image "120x120" crop="center" as im %}
            {% thumbnail image.image "600x600" as full %}
                <a rel='gallery[pp_gal]' href="{{ full.url }}">
                        <img class="preview" {% imagestore_alt image forloop.counter %} src="{{ im.url }}">
                </a>
            {% endthumbnail %}
        {% endthumbnail %}
    {% endfor %}

    <script type="text/javascript" charset="utf-8">
    $(function() {
        $("a[rel^='gallery']").prettyPhoto({
            allow_resize: true,
            changepicturecallback: function() {
                $(".pp_overlay").css("height", $(document).height());
            }
        });
    });
    </script>
</div>
